<?php

namespace Sifast\ProjectBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;

class ExperienceAdmin extends Admin
{
 
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
        ->with('L1')
            ->add('societe','text',array(
                'label'=>'Socièté:',
            ))
            ->add('posteOccupe','text',array(
                'label'=>'Poste occupé:',
            ))
        ->end()
        ->with('L2')        
             ->add('dateDebut', 'date', array(
                    'label'=> 'Date de début',
                    'widget' => 'single_text',
                    'format' => 'MM/dd/yyyy',
                    'attr' => array('class' => 'datepicker')
                )) 
            ->add('dateFin', 'date', array(
                    'label'=> 'Date de fin',
                    'widget' => 'single_text',
                    'format' => 'MM/dd/yyyy',
                    'attr' => array('class' => 'datepicker')
                ))
       ->end()
       ->with('L3')         
            ->add('observations','text',array(
                'label'=>'Observation:',
            ))
      ->end()     ;
            
    }

    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper
            ->add('societe')
            ->add('posteOccupe')
            ->add('observations')
            ->add('dateDebut') 
            ->add('dateFin');
            
    }

    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper
            ->addIdentifier('societe')
            ->add('posteOccupe')
            ->add('observations')
            ->add('dateDebut') 
            ->add('dateFin');
            
            }
}